import { http } from "@/utils/http";

export const useNoticeAPI = () => {
  const getNoticeList = (
    key: string = "",
    page: number = 1,
    rows: number = 15
  ): any => {
    return http.get("dynamic/report/page", {
      params: {
        key,
        page,
        rows
      }
    });
  };

  const getNewNotice = (): any => {
    return http.get("dynamic/report/getNewReport");
  };

  const uploadNotice = (title: string, context: string): any => {
    return http.get("dynamic/report/uploadReport", {
      params: {
        title,
        context
      }
    });
  };


  return {
    getNoticeList,
    getNewNotice,
    uploadNotice
  };
};